//
//  CinemaCell.m
//  DaHaiDouBan
//
//  Created by dllo on 15/11/1.
//  Copyright © 2015年 Wang Dahai. All rights reserved.
//

#import "CinemaCell.h"

@implementation CinemaCell
-(void)dealloc
{
    [_addressLabel release];
    [_telephoneLabel release];
    [_cinemaNameLabel release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createSubViews];
        
    }
    return self;
}
-(void)createSubViews
{
    
    UIImageView *backImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5,5,365,129)];
    backImageView.image = [UIImage imageNamed:@"bg_eventlistcell@2x"];
    
    [self addSubview:backImageView];
    [backImageView release];
    
    self.cinemaNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 350, 30)];
    [self addSubview:self.cinemaNameLabel];
    [_cinemaNameLabel release];
    self.cinemaNameLabel.font = [UIFont systemFontOfSize:25];
    
    self.addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 40, 350, 60)];
    [self addSubview:self.addressLabel];
    [_addressLabel release];
    self.addressLabel.numberOfLines = 0;
    
    self.telephoneLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 90, 350, 40)];
    [self addSubview:self.telephoneLabel];
    [_telephoneLabel release];
    
}
-(void)setCinema:(Cinema *)cinema
{
    if (_cinema != cinema) {
        
        [_cinema release];
        
        _cinema = [cinema retain];
    }
    
    self.cinemaNameLabel.text = _cinema.cinemaName;
    self.addressLabel.text = _cinema.address;
    self.telephoneLabel.text = _cinema.telephone;
}






- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
